package com.yh.base.common;

import java.io.InputStream;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

/**
 * 
 * 装载应用级缓存（适用于全局服务器内公共数据，更改少，查询多的特点）
 * 
 * @author  严华
 * @version  [版本号, 2012-11-4]
 * @see  [相关类/方法]
 * @since  [产品/模块版本]
 */
@SuppressWarnings("serial")
public class ApplicationStartListener extends HttpServlet {
	@Override
	public void init() throws ServletException {
		try {
			GlobalConfig globalConfig = GlobalConfig.newInstance();
			InputStream resourceStream = this.getClass().getClassLoader().getResourceAsStream("/appconfig.xml");
			globalConfig.initDataMap(this.getServletContext(), resourceStream);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
